<?php
/**
 * Created by IntelliJ IDEA.
 * User: m1573
 * Date: 2022/7/22
 * Time: 21:01
 */
$cname = $_GET["cname"];

include("include/util.inc.php");
insert_category($cname,$PDO);

$res = select_category($PDO);

$html = "<select class='form-select' id='newcategory'>";
for($i = 0; $i < count($res);$i = $i + 1){
    $cname = $res[$i]["cname"];
    $html = $html . "<option value='$cname'>$cname</option>";
}
$html = $html . "</select>";
echo $html;
?>